from tools import all_flow, all_flow_858, all_flow_857
from global_parameter import ip, port, username, DB_NAME

channel_2v2_scene1 = [
    "NULL, 1, 1, 1, '1', 5, '1', 2, '2023-03-23 15:31:08', NULL, '', 3, '', '1', NULL, NULL, NULL",
    "NULL, 1, 2, 2, '2', 5, '1', 2, '2023-03-23 15:31:08', NULL, '', 3, '', '1', NULL, NULL, NULL",
    "NULL, 1, 3, 3, '3', 4, '1', 2, '2023-03-23 15:31:08', NULL, '', 3, '', '1', NULL, NULL, NULL",
    "NULL, 1, 4, 4, '4', 4, '1', 2, '2023-03-23 15:31:08', NULL, '', 3, '', '1', NULL, NULL, NULL"]

# 低压不评估
channel_2v2_scene3 = [
    "NULL, 1, 1, 1, '1', 5, '1', 2, '2023-03-23 15:31:08', NULL, '', 3, '', '1', NULL, NULL, NULL",
    "NULL, 1, 2, 2, '2', 5, '1', 2, '2023-03-23 15:31:08', NULL, '', 3, '', '1', NULL, NULL, NULL",
    "NULL, 1, 3, 3, '3', 4, '1', 2, '2023-03-23 15:31:08', NULL, '', 3, '', '0', NULL, NULL, NULL",
    "NULL, 1, 4, 4, '4', 4, '1', 2, '2023-03-23 15:31:08', NULL, '', 3, '', '0', NULL, NULL, NULL"]

no_group_2v2 = [
    "1, 1, 5, 1",
    "1, 2, 5, 1",
    "1, 3, 4, 1",
    "1, 4, 4, 1"]

no_group_2v0 = [
    "1, 1, 5, 1",
    "1, 2, 5, 1"]

# 通用算法
algo_2v2_scene1 = [
    "4, '1', '1', '1,3', '0', '', '0', NULL, '2023-04-14 11:44:50', NULL, NULL, NULL, NULL, NULL, 7, 14, 7, 14, '0', '0', '1'"]

# 自适应算法
algo_2v2_scene2 = [
    "4, '2', '1', '1,3', '0', '', '0', NULL, '2023-04-14 11:44:50', NULL, NULL, NULL, NULL, NULL, 7, 14, 7, 14, '0', '0', '1'"]

"""
330kV电压等级对应的字典键值(8)  330kV电压等级线路数  330kV电压等级同源标志(True  False)  330kV电压等级分列标志(True  False)  330kV电压等级停电标志(True  False) 
220kV电压等级对应的字典键值(5)  220kV电压等级线路数  220kV电压等级同源标志(True  False)  220kV电压等级分列标志(True  False)  220kV电压等级停电标志(True  False) 
110kV电压等级对应的字典键值(4)  110kV电压等级线路数  110kV电压等级同源标志(True  False)  110kV电压等级分列标志(True  False)  110kV电压等级停电标志(True  False) 
10kV 电压等级对应的字典键值(3)  10kV 电压等级线路数  10kV 电压等级同源标志(True  False)  10kV 电压等级分列标志(True  False)  10kV 电压等级停电标志(True  False) 
"""
v_arg_2v2_gao_bing_di_bing = [8, 0, False, False, False,
                              5, 2, False, False, False,
                              4, 2, False, False, False,
                              3, 0, False, False, False]

v_arg_2v2_gao_tong_di_bing = [8, 0, False, False, False,
                              5, 2, True, False, False,
                              4, 2, False, False, False,
                              3, 0, False, False, False]

v_arg_2v2_gao_bing_di_fen = [8, 0, False, False, False,
                             5, 2, False, False, False,
                             4, 2, False, True, False,
                             3, 0, False, False, False]

v_arg_2v2_gao_fen_di_bing = [8, 0, False, False, False,
                             5, 2, False, True, False,
                             4, 2, False, False, False,
                             3, 0, False, False, False]

v_arg_2v2_gao_fen_di_fen = [8, 0, False, False, False,
                            5, 2, False, True, False,
                            4, 2, False, True, False,
                            3, 0, False, False, False]

v_arg_2v2_gao_bing_di_ting = [8, 0, False, False, False,
                              5, 2, False, False, False,
                              4, 2, False, False, True,
                              3, 0, False, False, False]

v_arg_2v2_gao_tong_di_tong = [8, 0, False, False, False,
                              5, 2, True, False, False,
                              4, 2, True, False, False,
                              3, 0, False, False, False]

v_arg_2v2_gao_ting_di_ting = [8, 0, False, False, False,
                              5, 2, False, False, True,
                              4, 2, False, False, True,
                              3, 0, False, False, False]

v_arg_2v2_gao_bing_di_tong = [8, 0, False, False, False,
                              5, 2, False, False, False,
                              4, 2, True, False, False,
                              3, 0, False, False, False]

# ILAE-857 计算状态码_不评估场景_自适应算法
all_flow_857(ip, port, username, DB_NAME, v_arg_2v2_gao_bing_di_bing, "ILAE-857", channel_2v2_scene3, no_group_2v0,
             algo_2v2_scene2, [150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150],
             [None, None, 0.0, 0.0, None, None, 0.0, 0.0, None, None, 0.0, 0.0],
             [None, None, 0.0, 0.0, None, None, 0.0, 0.0, None, None, 0.0, 0.0], ['0', '0', '15', '15'],
             ['正常评估', '正常评估', '未执行误差计算', '未执行误差计算'], time_data=[-2, 1440 * 3])

# ILAE-858 计算状态码_不评估场景
all_flow_858(ip, port, username, DB_NAME, v_arg_2v2_gao_bing_di_bing, "ILAE-858", channel_2v2_scene3, no_group_2v0,
             algo_2v2_scene1, [150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150],
             [None, None, 0.0, 0.0, None, None, 0.0, 0.0, None, None, 0.0, 0.0],
             [None, None, 0.0, 0.0, None, None, 0.0, 0.0, None, None, 0.0, 0.0], ['0', '0', '15', '15'],
             ['正常评估', '正常评估', '未执行误差计算', '未执行误差计算'], time_data=[-2, 1440 * 3])

# ILAE-1117 计算状态码_通用算法_2V2无初始工况表
all_flow(ip, port, username, DB_NAME, v_arg_2v2_gao_bing_di_bing, "ILAE-1117", channel_2v2_scene1, no_group_2v2,
         algo_2v2_scene1, [150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150],
         [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
         [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], ['9', '9', '9', '9'],
         ['线路运行模式配置错误', '线路运行模式配置错误', '线路运行模式配置错误', '线路运行模式配置错误'],
         time_data=[-1, 780], update_sqls=['TRUNCATE dv_voltage_line_group_channel;'])

# ILAE-1118 计算状态码_通用算法_2V2无采集数据
all_flow(ip, port, username, DB_NAME, v_arg_2v2_gao_bing_di_bing, "ILAE-1118", channel_2v2_scene1, no_group_2v2,
         algo_2v2_scene1, [150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150],
         [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
         [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], ['6', '6', '6', '6'],
         ['无采样数据', '无采样数据', '无采样数据', '无采样数据'], time_data=[-1, 780],
         update_sqls=['TRUNCATE da_voltage_data_temp;'])

# ILAE-1119 计算状态码_自适应算法_2V2无采集数据
all_flow(ip, port, username, DB_NAME, v_arg_2v2_gao_bing_di_bing, "ILAE-1119", channel_2v2_scene1, no_group_2v2,
         algo_2v2_scene2, [150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150],
         [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
         [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], ['6', '6', '6', '6'],
         ['无采样数据', '无采样数据', '无采样数据', '无采样数据'], time_data=[-1, 780],
         update_sqls=['TRUNCATE da_voltage_data_temp;'])

# ILAE-1120 计算状态码_通用算法_2V2采集终止
all_flow(ip, port, username, DB_NAME, v_arg_2v2_gao_bing_di_bing, "ILAE-1120", channel_2v2_scene1, no_group_2v2,
         algo_2v2_scene1, [150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150],
         [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
         [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], ['7', '7', '7', '7'],
         ['采样数据不足780条', '采样数据不足780条', '采样数据不足780条', '采样数据不足780条'], time_data=[-1, 779])

# ILAE-1121 计算状态码_自适应算法_2V2采集终止
all_flow(ip, port, username, DB_NAME, v_arg_2v2_gao_bing_di_bing, "ILAE-1121", channel_2v2_scene1, no_group_2v2,
         algo_2v2_scene2, [150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150],
         [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
         [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], ['7', '7', '7', '7'],
         ['采样数据不足780条', '采样数据不足780条', '采样数据不足780条', '采样数据不足780条'], time_data=[-1, 779])

# ILAE-1122 计算状态码_通用算法_2V2高压1停电01
all_flow(ip, port, username, DB_NAME, v_arg_2v2_gao_bing_di_bing, "ILAE-1122", channel_2v2_scene1, no_group_2v2,
         algo_2v2_scene1, [150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150],
         [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
         [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], ['4', '4', '4', '4'],
         ['线路运行模式变化', '线路运行模式变化', '线路运行模式变化', '线路运行模式变化'], time_data=[-1, 780],
         update_sqls=[
             'UPDATE da_voltage_data_temp SET aa_fundamental_amplitude = 5 WHERE channel_num=1 ORDER BY collect_time LIMIT 61;'])

# ILAE-1123 计算状态码_通用算法_2V2高压1停电02
all_flow(ip, port, username, DB_NAME, v_arg_2v2_gao_bing_di_bing, "ILAE-1123", channel_2v2_scene1, no_group_2v2,
         algo_2v2_scene1, [150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150],
         [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
         [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], ['4', '4', '4', '4'],
         ['线路运行模式变化', '线路运行模式变化', '线路运行模式变化', '线路运行模式变化'], time_data=[-1, 780],
         update_sqls=['UPDATE da_voltage_data_temp SET aa_fundamental_amplitude = 5 WHERE channel_num=1;'])

# ILAE-1124 计算状态码_通用算法_2V2高压全停电
all_flow(ip, port, username, DB_NAME, v_arg_2v2_gao_bing_di_bing, "ILAE-1124", channel_2v2_scene1, no_group_2v2,
         algo_2v2_scene1, [150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150],
         [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
         [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], ['4', '4', '4', '4'],
         ['线路运行模式变化', '线路运行模式变化', '线路运行模式变化', '线路运行模式变化'], time_data=[-1, 780],
         update_sqls=[
             'UPDATE da_voltage_data_temp SET aa_fundamental_amplitude = 5 WHERE channel_num=1 or channel_num=2;'])

# ILAE-1125 计算状态码_自适应算法_2V2高压1停电01
all_flow(ip, port, username, DB_NAME, v_arg_2v2_gao_bing_di_bing, "ILAE-1125", channel_2v2_scene1, no_group_2v2,
         algo_2v2_scene2, [150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150],
         [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
         [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], ['4', '4', '4', '4'],
         ['线路运行模式变化', '线路运行模式变化', '线路运行模式变化', '线路运行模式变化'], time_data=[-1, 780],
         update_sqls=[
             'UPDATE da_voltage_data_temp SET aa_fundamental_amplitude = 5 WHERE channel_num=1 ORDER BY collect_time LIMIT 61;'])

# ILAE-1126 计算状态码_自适应算法_2V2高压1停电02
all_flow(ip, port, username, DB_NAME, v_arg_2v2_gao_bing_di_bing, "ILAE-1126", channel_2v2_scene1, no_group_2v2,
         algo_2v2_scene2, [150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150],
         [0.0, 0.0, None, None, 0.0, 0.0, None, None, 0.0, 0.0, None, None],
         [0.0, 0.0, None, None, 0.0, 0.0, None, None, 0.0, 0.0, None, None], ['1', '3', '0', '0'],
         ['线路停电', '线路分列运行', '正常评估', '正常评估'], time_data=[-1, 780],
         update_sqls=['UPDATE da_voltage_data_temp SET aa_fundamental_amplitude = 5 WHERE channel_num=1;'])

# ILAE-1127 计算状态码_自适应算法_2V2高压全停电
all_flow(ip, port, username, DB_NAME, v_arg_2v2_gao_bing_di_bing, "ILAE-1127", channel_2v2_scene1, no_group_2v2,
         algo_2v2_scene2, [150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150],
         [0.0, 0.0, None, None, 0.0, 0.0, None, None, 0.0, 0.0, None, None],
         [0.0, 0.0, None, None, 0.0, 0.0, None, None, 0.0, 0.0, None, None], ['1', '1', '0', '0'],
         ['线路停电', '线路停电', '正常评估', '正常评估'], time_data=[-1, 780],
         update_sqls=[
             'UPDATE da_voltage_data_temp SET aa_fundamental_amplitude = 5 WHERE channel_num=1 or channel_num=2;'])

# ILAE-1128 计算状态码_通用算法_2V2高低压全分列
all_flow(ip, port, username, DB_NAME, v_arg_2v2_gao_fen_di_fen, "ILAE-1128", channel_2v2_scene1, no_group_2v2,
         algo_2v2_scene1, [150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150],
         [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
         [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], ['3', '3', '3', '3'],
         ['线路分列运行', '线路分列运行', '线路分列运行', '线路分列运行'], time_data=[-1, 780])

# ILAE-1129 计算状态码_自适应算法_2V2高低压全分列
all_flow(ip, port, username, DB_NAME, v_arg_2v2_gao_fen_di_fen, "ILAE-1129", channel_2v2_scene1, no_group_2v2,
         algo_2v2_scene2, [150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150],
         [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
         [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], ['3', '3', '3', '3'],
         ['线路分列运行', '线路分列运行', '线路分列运行', '线路分列运行'], time_data=[-1, 780])

# ILAE-1130 计算状态码_通用算法_2V2高低压全同源
all_flow(ip, port, username, DB_NAME, v_arg_2v2_gao_tong_di_tong, "ILAE-1130", channel_2v2_scene1, no_group_2v2,
         algo_2v2_scene1, [150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150],
         [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
         [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], ['2', '2', '2', '2'],
         ['信号同源且同电压等级下无并列运行线路', '信号同源且同电压等级下无并列运行线路',
          '信号同源且同电压等级下无并列运行线路', '信号同源且同电压等级下无并列运行线路'], time_data=[-1, 780])

# ILAE-1131 计算状态码_自适应算法_2V2高低压全同源
all_flow(ip, port, username, DB_NAME, v_arg_2v2_gao_tong_di_tong, "ILAE-1131", channel_2v2_scene1, no_group_2v2,
         algo_2v2_scene2, [150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150],
         [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
         [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], ['2', '2', '2', '2'],
         ['信号同源且同电压等级下无并列运行线路', '信号同源且同电压等级下无并列运行线路',
          '信号同源且同电压等级下无并列运行线路', '信号同源且同电压等级下无并列运行线路'], time_data=[-1, 780])

# ILAE-1132 计算状态码_通用算法_2V2比差为0
all_flow(ip, port, username, DB_NAME, v_arg_2v2_gao_bing_di_bing, "ILAE-1132", channel_2v2_scene1, no_group_2v2,
         algo_2v2_scene1, [150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150],
         [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
         [None, None, None, None, None, None, None, None, None, None, None, None], ['8', '8', '8', '8'],
         ['需人工运维', '需人工运维', '需人工运维', '需人工运维'], time_data=[-1, 0], is_append=True)

# ILAE-1133 计算状态码_自适应算法_2V2比差为0
all_flow(ip, port, username, DB_NAME, v_arg_2v2_gao_bing_di_bing, "ILAE-1133", channel_2v2_scene1, no_group_2v2,
         algo_2v2_scene2, [150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150],
         [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
         [None, None, None, None, None, None, None, None, None, None, None, None], ['8', '8', '8', '8'],
         ['需人工运维', '需人工运维', '需人工运维', '需人工运维'], time_data=[-1, 0], is_append=True)

# ILAE-1134 计算状态码_通用算法_2V2高低压全停电
all_flow(ip, port, username, DB_NAME, v_arg_2v2_gao_ting_di_ting, "ILAE-1134", channel_2v2_scene1, no_group_2v2,
         algo_2v2_scene1, [150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150],
         [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
         [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], ['1', '1', '1', '1'],
         ['线路停电', '线路停电', '线路停电', '线路停电'], time_data=[-1, 780],
         update_sqls=[
             'UPDATE da_voltage_data_temp SET aa_fundamental_amplitude = 5,bb_fundamental_amplitude = 5,cc_fundamental_amplitude = 5;'])

# ILAE-1135 计算状态码_自适应算法_2V2高低压全停电
all_flow(ip, port, username, DB_NAME, v_arg_2v2_gao_ting_di_ting, "ILAE-1135", channel_2v2_scene1, no_group_2v2,
         algo_2v2_scene2, [150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150],
         [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
         [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], ['1', '1', '1', '1'],
         ['线路停电', '线路停电', '线路停电', '线路停电'], time_data=[-1, 780],
         update_sqls=[
             'UPDATE da_voltage_data_temp SET aa_fundamental_amplitude = 5,bb_fundamental_amplitude = 5,cc_fundamental_amplitude = 5;'])

# ILAE-1136 计算状态码_自适应算法_2V2低压全停电
all_flow(ip, port, username, DB_NAME, v_arg_2v2_gao_bing_di_ting, "ILAE-1136", channel_2v2_scene1, no_group_2v2,
         algo_2v2_scene2, [150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150],
         [None, None, 0.0, 0.0, None, None, 0.0, 0.0, None, None, 0.0, 0.0],
         [None, None, 0.0, 0.0, None, None, 0.0, 0.0, None, None, 0.0, 0.0], ['0', '0', '1', '1'],
         ['正常评估', '正常评估', '线路停电', '线路停电'], time_data=[-1, 780],
         update_sqls=[
             'UPDATE da_voltage_data_temp SET aa_fundamental_amplitude = 5,bb_fundamental_amplitude = 5,cc_fundamental_amplitude = 5 WHERE channel_num=3 or channel_num=4;'])

# ILAE-1142 计算状态码_自适应算法_2V2低压同源
all_flow(ip, port, username, DB_NAME, v_arg_2v2_gao_bing_di_tong, "ILAE-1142", channel_2v2_scene1, no_group_2v2,
         algo_2v2_scene2, [150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150],
         [None, None, 0.0, 0.0, None, None, 0.0, 0.0, None, None, 0.0, 0.0],
         [None, None, 0.0, 0.0, None, None, 0.0, 0.0, None, None, 0.0, 0.0], ['0', '0', '2', '2'],
         ['正常评估', '正常评估', '信号同源且同电压等级下无并列运行线路', '信号同源且同电压等级下无并列运行线路'],
         time_data=[-1, 780])

# ILAE-1145 计算状态码_自适应算法_2V2低压停电1条
all_flow(ip, port, username, DB_NAME, v_arg_2v2_gao_bing_di_bing, "ILAE-1145", channel_2v2_scene1, no_group_2v2,
         algo_2v2_scene2, [150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150],
         [None, None, 0.0, 0.0, None, None, 0.0, 0.0, None, None, 0.0, 0.0],
         [None, None, 0.0, 0.0, None, None, 0.0, 0.0, None, None, 0.0, 0.0], ['0', '0', '3', '1'],
         ['正常评估', '正常评估', '线路分列运行', '线路停电'], time_data=[-1, 780],
         update_sqls=[
             'UPDATE da_voltage_data_temp SET aa_fundamental_amplitude = 5, bb_fundamental_amplitude = 5, cc_fundamental_amplitude = 5 WHERE channel_num=4;'])

# ILAE-1146 计算状态码_自适应算法_2V2低压全停电
all_flow(ip, port, username, DB_NAME, v_arg_2v2_gao_bing_di_ting, "ILAE-1146", channel_2v2_scene1, no_group_2v2,
         algo_2v2_scene2, [150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150],
         [None, None, 0.0, 0.0, None, None, 0.0, 0.0, None, None, 0.0, 0.0],
         [None, None, 0.0, 0.0, None, None, 0.0, 0.0, None, None, 0.0, 0.0], ['0', '0', '1', '1'],
         ['正常评估', '正常评估', '线路停电', '线路停电'], time_data=[-1, 780])

# ILAE-1149 计算状态码_通用算法_2V2低压停电1条
all_flow(ip, port, username, DB_NAME, v_arg_2v2_gao_bing_di_bing, "ILAE-1149", channel_2v2_scene1, no_group_2v2,
         algo_2v2_scene1, [150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150],
         [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
         [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], ['4', '4', '4', '4'],
         ['线路运行模式变化', '线路运行模式变化', '线路运行模式变化', '线路运行模式变化'], time_data=[-1, 780],
         update_sqls=[
             'UPDATE da_voltage_data_temp SET aa_fundamental_amplitude = 5, bb_fundamental_amplitude = 5, cc_fundamental_amplitude = 5 WHERE channel_num=4;'])

# ILAE-1150 计算状态码_通用算法_2V2低压全停电
all_flow(ip, port, username, DB_NAME, v_arg_2v2_gao_bing_di_ting, "ILAE-1150", channel_2v2_scene1, no_group_2v2,
         algo_2v2_scene1, [150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150],
         [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
         [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], ['4', '4', '4', '4'],
         ['线路运行模式变化', '线路运行模式变化', '线路运行模式变化', '线路运行模式变化'], time_data=[-1, 780])

# ILAE-1165 计算状态码_通用算法_2V2高压分列
all_flow(ip, port, username, DB_NAME, v_arg_2v2_gao_fen_di_bing, "ILAE-1165", channel_2v2_scene1, no_group_2v2,
         algo_2v2_scene1, [150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150],
         [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
         [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], ['4', '4', '4', '4'],
         ['线路运行模式变化', '线路运行模式变化', '线路运行模式变化', '线路运行模式变化'], time_data=[-1, 780])

# ILAE-1166 计算状态码_自适应算法_2V2高压分列
all_flow(ip, port, username, DB_NAME, v_arg_2v2_gao_fen_di_bing, "ILAE-1166", channel_2v2_scene1, no_group_2v2,
         algo_2v2_scene2, [150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150],
         [0.0, 0.0, None, None, 0.0, 0.0, None, None, 0.0, 0.0, None, None],
         [0.0, 0.0, None, None, 0.0, 0.0, None, None, 0.0, 0.0, None, None], ['3', '3', '0', '0'],
         ['线路分列运行', '线路分列运行', '正常评估', '正常评估'], time_data=[-1, 780])

# ILAE-1167 计算状态码_通用算法_2V2高压同源
all_flow(ip, port, username, DB_NAME, v_arg_2v2_gao_tong_di_bing, "ILAE-1167", channel_2v2_scene1, no_group_2v2,
         algo_2v2_scene1, [150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150],
         [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
         [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], ['4', '4', '4', '4'],
         ['线路运行模式变化', '线路运行模式变化', '线路运行模式变化', '线路运行模式变化'], time_data=[-1, 780])

# ILAE-1168 计算状态码_自适应算法_2V2高压同源
all_flow(ip, port, username, DB_NAME, v_arg_2v2_gao_tong_di_bing, "ILAE-1168", channel_2v2_scene1, no_group_2v2,
         algo_2v2_scene2, [150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150],
         [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
         [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], ['2', '2', '0', '0'],
         ['信号同源且同电压等级下无并列运行线路', '信号同源且同电压等级下无并列运行线路', '正常评估', '正常评估'],
         time_data=[-1, 780])

# ILAE-1169 计算状态码_通用算法_2V2低压分列
all_flow(ip, port, username, DB_NAME, v_arg_2v2_gao_bing_di_fen, "ILAE-1169", channel_2v2_scene1, no_group_2v2,
         algo_2v2_scene1, [150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150],
         [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
         [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], ['4', '4', '4', '4'],
         ['线路运行模式变化', '线路运行模式变化', '线路运行模式变化', '线路运行模式变化'], time_data=[-1, 780])

# ILAE-1170 计算状态码_自适应算法_2V2低压分列
all_flow(ip, port, username, DB_NAME, v_arg_2v2_gao_bing_di_fen, "ILAE-1170", channel_2v2_scene1, no_group_2v2,
         algo_2v2_scene2, [150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150],
         [None, None, 0.0, 0.0, None, None, 0.0, 0.0, None, None, 0.0, 0.0],
         [None, None, 0.0, 0.0, None, None, 0.0, 0.0, None, None, 0.0, 0.0], ['0', '0', '3', '3'],
         ['正常评估', '正常评估', '线路分列运行', '线路分列运行'], time_data=[-1, 780])

# ILAE-1171 计算状态码_通用算法_2V2低压同源
all_flow(ip, port, username, DB_NAME, v_arg_2v2_gao_bing_di_tong, "ILAE-1171", channel_2v2_scene1, no_group_2v2,
         algo_2v2_scene1, [150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150],
         [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
         [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], ['4', '4', '4', '4'],
         ['线路运行模式变化', '线路运行模式变化', '线路运行模式变化', '线路运行模式变化'], time_data=[-1, 780])
